package com.sixth.controller;



import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sixth.core.entity.OrderCharge;
import com.sixth.core.vo.R;
import com.sixth.service.OrderChargeService;
import com.sixth.vo.OrderChargeItemVo;
import com.sixth.vo.OrderChargeVo;
import com.sixth.vo.OrderVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: sixth-hospital-parent
 * @description:
 * @author: 李劲锋
 * @create: 2024-08-15 21:14
 **/
@RestController
@RequestMapping("/charge/order")
@Api(tags = "缴费")
public class OrderChargeController {
    @Autowired
    private OrderChargeService orderChargeService;

    @PostMapping("/listByPage")
    @ApiOperation(value = "缴费列表")
    public R<IPage<OrderCharge>> list(@RequestBody OrderVo orderVo){
        return orderChargeService.selectByPage(orderVo);
    }

    @PostMapping("/createNavigateCash")
    @ApiOperation(value = "创建现金支付订单")
    public R createNavigateCash(@RequestBody OrderChargeVo orderChargeVo) {
        return orderChargeService.createNavigateCash(orderChargeVo);
    }

    @PostMapping("/createNavigateWenXin")
    @ApiOperation(value = "创建微信支付订单")
    public R createNavigateWenXin(@RequestBody OrderChargeVo orderChargeVo) {
        return orderChargeService.createNavigateWenXin(orderChargeVo);
    }

    @PostMapping("/queryPayStatus/{orderId}")
    @ApiOperation(value = "拉起微信支付二维码")
    public R queryPayStatus(@PathVariable String orderId) {
        return orderChargeService.queryPayStatus(orderId);
    }

    @PostMapping("/queryPayStatus2/{orderId}")
    @ApiOperation(value = "查询支付状态")
    public R queryPayStatus2(@PathVariable String orderId) {
        return orderChargeService.queryPayStatus2(orderId);
    }

    @PostMapping("/appClient")
    @ApiOperation(value = "app端支付")
    public R appClient(@RequestBody List<String> itemIds) {
        return orderChargeService.appClient(itemIds);
    }





}
